<?php
class Friend extends User
{
    public function isFriend($user_id)
    {
        $fid = $this->user_id;
        $query = 'SELECT `friends` FROM `players_friends` WHERE `user_id`='.$fid;

        $result = _database::torow($query);
        if(is_array($result) && $result['friends'])
        {
            $friend_flist = explode(',',$result['friends']);
            if(in_array($user_id, $friend_flist))
            {
                return true; // is friends
            }
            else return false; // not friends
        }
        else return false; // not friends
    }
}
?>
